package com.coding365.provider.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.coding365.api.ServiceApiA;
import com.coding365.api.ServiceApiB;
import org.springframework.stereotype.Component;

import java.util.Random;

@Component
@Service
public class ServiceApiBImpl implements ServiceApiB {
    @Override
    public void methodB() {
        Random random = new Random(System.currentTimeMillis() + 2);
        int i = random.nextInt(100000);
        random = new Random(i);
        i = random.nextInt(100);
        try {
            Thread.sleep(i);
            System.out.println("this is method B:sleep(ms)==>" + i );
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
